/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/appr-contract/hetonghtzb/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/appr-contract/hetonghtzb',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/appr-contract/hetonghtzb/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/appr-contract/hetonghtzb/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/appr-contract/hetonghtzb',
    method: 'put',
    data: obj
  })
}

export function getList(id) {
    return request({
      url: '/appr-contract/hetonghtzb/getHetongHtzbList/' + id,
      method: 'get'
    })
}

export function getListNoDept(id,streamId) {
  return request({
    url: '/appr-contract/hetonghtzb/getHetongHtzbListNoDept/' + id+'/'+streamId,
    method: 'get'
  })
}

export function getListChild(query) {
  return request({
    url: '/appr-contract/workFlowHtzb/getList',
    method: 'get',
    params: query
  })
}

export function getFormula() {
    return request({
      url: '/appr-contract/hetonghtzb/getFormula',
      method: 'get'
    })
}

export function getPage(query) {
    return request({
      url: '/appr-contract/hetonghtzb/getPage',
      method: 'get',
      params: query
    })
}

export function getPageChild(query) {
  return request({
    url: '/appr-contract/workFlowHtzb/getPageChild',
    method: 'get',
    params: query
  })
}

export function okApi(id) {
    return request({
      url: '/appr-contract/hetonghtzb/ok/'+id,
      method: 'get'
    })
}

export function okAllApi(query) {
    return request({
      url: '/appr-contract/hetonghtzb/okAll',
      method: 'post',
      data: query
    })
}
export function okAllByWbsh(query) {
  return request({
    url: '/appr-contract/hetonghtzb/okAllByWbsh',
    method: 'post',
    data: query
  })
}
// 排序保存
export function saveZhibiaoSort(query) {
  return request({
    url: '/appr-contract/hetonghtzb/saveZhibiaoSort',
    method: 'post',
    data: query
  })
}

export function okAllChildApi(query) {
  return request({
    url: '/appr-contract/hetongwfhandle/okAll',
    method: 'post',
    data: query
  })
}

export function backAllChildApi(query) {
  return request({
    url: '/appr-contract/hetongwfhandle/backAll',
    method: 'post',
    data: query
  })
}

export function backApi(id) {
    return request({
      url: '/appr-contract/hetonghtzb/back/'+id,
      method: 'get'
    })
}

export function backAllApi(query) {
    return request({
      url: '/appr-contract/hetonghtzb/backAll',
      method: 'post',
      data: query
    })
}

export function saveHtData(query) {
  return request({
    url: '/appr-contract/hetonghtcj/saveHtData',
    method: 'post',
    data: query
  })
}

export function fetchListPage(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getPage1',
    method: 'get',
    params: query
  })
}

export function tbshokApi(id) {
  return request({
    url: '/appr-contract/hetonghtzb/tbshok/'+id,
    method: 'get'
  })
}

export function tbshokAllApi(query) {
  return request({
    url: '/appr-contract/hetonghtzb/tbshokAll',
    method: 'post',
    data: query
  })
}
export function htzbisflag(query) {
  return request({
    url: '/appr-contract/hetonghtzb/htzbisflag',
    method: 'post',
    data: query
  })
}
export function tbshbackApi(id) {
  return request({
    url: '/appr-contract/hetonghtzb/tbshback/'+id,
    method: 'get'
  })
}

export function tbshbackAllApi(query) {
  return request({
    url: '/appr-contract/hetonghtzb/tbshbackAll',
    method: 'post',
    data: query
  })
}

export function getNormByTypeAndDeptId(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getNormByTypeAndDeptId',
    method: 'get',
    params: query
  })
}

export function getDataProvider(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getDataProvider',
    method: 'get',
    params: query
  })
}

export function getZhibiaoCheckdData(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoCheckdData',
    method: 'get',
    params: query
  })
}
export function getZhibiaoCheckdDataJghz(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoCheckdDataJghz',
    method: 'get',
    params: query
  })
}

//从原来的get请求改成post请求
export function getZhibiaoData(obj) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoData',
    method: 'post',
    data: obj
  })
}
export function getZhibiaoDatafortb(obj) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoDatafortb',
    method: 'post',
    data: obj
  }) 
}
export function saveZhibiaoData(query) {
  return request({
    url: '/appr-contract/hetonghtzb/saveZhibiaoData',
    method: 'post',
    data: query
  })
}
//指标拟定汇总
export function getZhibiaoCheckndData(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoCheckndData',
    method: 'get',
    params: query
  })
}
export function getZhibiaoCheckndDataforjg(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoCheckndDataforjg',
    method: 'get',
    params: query
  })
}
export function getZhibiaoCheckndDataHtsh(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getZhibiaoCheckndDataHtsh',
    method: 'get',
    params: query
  })
}

//批量删除
export function deleteBatch(query) {
  return request({
    url: '/appr-contract/hetonghtzb/deleteBatch',
    method: 'get',
    params: query
  })
}

export function tbshokAllByContract(query) {
  return request({
    url: '/appr-contract/hetonghtzb/tbshokAllByContract',
    method: 'post',
    data: query
  })
}

export function tbshbackAllByContract(query) {
  return request({
    url: '/appr-contract/hetonghtzb/tbshbackAllByContract',
    method: 'post',
    data: query
  })
}


export function getListByzbnd2(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getListByzbndAndNdId',
    method: 'get',
    params: query
  })
}
export function getListByzbnd(query) {
  return request({
    url: '/appr-contract/hetonghtzb/getListByzbnd',
    method: 'get',
    params: query
  })
}
//指标审核查询
export function pageByzbsh(query) {
  return request({
    url: '/appr-contract/hetongzbnd/pageByzbsh',
    method: 'get',
    params: query
  })
}

export function addHetongHtzb(obj) {
  return request({
    url: '/appr-contract/hetonghtcj/addHetongHtzb',
    method: 'post',
    data: obj
  })
}

export function copyZhiBiao(query) {
  return request({
    url: '/appr-contract/hetonghtcj/copyZhiBiao',
    method: 'get',
    params: query
  })
}
// 校验汇总完成和文本审核完成驳回
export function checkHqcollections(query) {
  return request({
    url: '/appr-contract/hetonghtcj/checkHqcollections',
    method: 'get',
    params: query
  })
}
// /process汇总完成和文本审核完成驳回
export function process(query) {
  return request({
    url: '/appr-contract/hetonghtcj/process',
    method: 'post',
    data: query
  })
}
